import request from '@/utils/request'

// 查询客户列表
export function listInfo(query) {
  return request({
    url: '/customerInfo/list',
    method: 'get',
    params: query
  })
}

// 查询客户详细
export function getInfo(id) {
  return request({
    url: '/customerInfo/' + id,
    method: 'get'
  })
}

// 新增客户
export function addInfo(data) {
  return request({
    url: '/customerInfo',
    method: 'post',
    data: data
  })
}

// 修改客户
export function updateInfo(data) {
  return request({
    url: '/customerInfo',
    method: 'put',
    data: data
  })
}

// 删除客户
export function delInfo(id) {
  return request({
    url: '/customerInfo/' + id,
    method: 'delete'
  })
}

// 添加客户需求
export function addNeed(data) {
  return request({
    url: '/customerInfo/addNeed',
    method: 'post',
    data: data
  })
}

// 删除客户需求
export function deleteNeed(id) {
  return request({
    url: '/customerInfo/deleteNeed/' + id,
    method: 'delete'
  })
}

// 客户需求列表
export function needList(query) {
  return request({
    url: '/customerInfo/needList',
    method: 'get',
    params: query
  })
}

// 客户需求列表
export function allocationList(query) {
  return request({
    url: '/customerInfo/allocationList',
    method: 'get',
    params: query
  })
}

// 客户信息快照列表
export function snapshotList(query) {
  return request({
    url: '/customerInfo/snapshotList',
    method: 'get',
    params: query
  })
}

// 客户信息快照详情
export function getCustomerSnapshot(id) {
  return request({
    url: '/customerInfo/getCustomerSnapshot/' + id,
    method: 'get'
  })
}

// 客户信息快照回滚
export function backCustomerSnapshot(data) {
  return request({
    url: '/customerInfo/backCustomerSnapshot',
    method: 'put',
    data: data
  })
}

// 跟进客户
export function followCustomer(data) {
  return request({
    url: '/customerInfo/followCustomer',
    method: 'put',
    data: data
  })
}

// 跟进提醒
export function followRemind(data) {
  return request({
    url: '/customerInfo/followRemind',
    method: 'put',
    data: data
  })
}

// 跟进还款
export function followRepayment(data) {
  return request({
    url: '/customerInfo/followRepayment',
    method: 'put',
    data: data
  })
}

// 认领客户
export function claimCustomer(data) {
  return request({
    url: '/customerInfo/claimCustomer',
    method: 'put',
    data: data
  })
}

// 分配客户
export function distCustomer(data) {
  return request({
    url: '/customerInfo/distCustomer',
    method: 'put',
    data: data
  })
}

// 转售前公共池
export function publicDist(data) {
  return request({
    url: '/customerInfo/publicDist',
    method: 'put',
    data: data
  })
}

// 客户转后期
export function stateToLoan(data) {
  return request({
    url: '/customerInfo/stateToLoan',
    method: 'put',
    data: data
  })
}

// 分配后期
export function distLoan(data) {
  return request({
    url: '/customerInfo/distLoan',
    method: 'put',
    data: data
  })
}

// 后期打回
export function backLoan(data) {
  return request({
    url: '/customerInfo/backLoan',
    method: 'put',
    data: data
  })
}

// 转后期公共池
export function publicLoan(data) {
  return request({
    url: '/customerInfo/publicLoan',
    method: 'put',
    data: data
  })
}

// 客户转售后
export function stateToAfter(data) {
  return request({
    url: '/customerInfo/stateToAfter',
    method: 'put',
    data: data
  })
}

// 分配售后
export function distAfter(data) {
  return request({
    url: '/customerInfo/distAfter',
    method: 'put',
    data: data
  })
}

// 售后打回
export function backAfter(data) {
  return request({
    url: '/customerInfo/backAfter',
    method: 'put',
    data: data
  })
}

// 转售后公共池
export function publicAfter(data) {
  return request({
    url: '/customerInfo/publicAfter',
    method: 'put',
    data: data
  })
}

// 获取信息列表
export function getMessageTotal() {
  return request({
    url: '/customerInfo/getMessageTotal',
    method: 'get'
  })
}

// 获取信息列表
export function selectUserList(type) {
  return request({
    url: '/customerInfo/getUserList/' + type,
    method: 'get'
  })
}
